<%@ page import="activity.Manual" %>

<div class="fieldcontain ${hasErrors(bean: manualInstance, field: 'name', 'error')} ">
	<label for="name">
		<g:message code="manual.name.label" default="Name" />
		
	</label>
	<g:textField name="name" value="${manualInstance?.name}" size="40" />
</div>

<div class="fieldcontain ${hasErrors(bean: manualInstance, field: 'active', 'error')} ">
	<label for="active">
		<g:message code="manual.active.label" default="Active" />
		
	</label>
	<g:select name="active" from="${manualInstance.constraints.active.inList}" value="${manualInstance?.active}" valueMessagePrefix="manual.active" noSelection="['': '']"/>
</div>

<div class="fieldcontain ${hasErrors(bean: manualInstance, field: 'event', 'error')} required">
	<label for="event">
		<g:message code="manual.event.label" default="Event" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="event" name="event.id" from="${activity.Event.list()}" optionKey="id" required="" value="${manualInstance?.event?.id}" class="many-to-one"/>
</div>

<div class="fieldcontain ${hasErrors(bean: manualInstance, field: 'subject', 'error')} required">
	<label for="subject">
		<g:message code="manual.subject.label" default="Subject" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="subject" required="" value="${manualInstance?.subject}" size="40" />
</div>

<div class="fieldcontain">
    <label for="content">欄位</label>
    <div style="display:inline-block">
        <a onclick="javascript:CKEDITOR.instances.content.insertText('#serial.name#');">活動名稱</a>
        <a onclick="javascript:CKEDITOR.instances.content.insertText('#event.name#');">場次名稱</a>
        <a onclick="javascript:CKEDITOR.instances.content.insertText('#event.place#');">場次地點</a>
        <a onclick="javascript:CKEDITOR.instances.content.insertText('#event.dateStart#');">開始時間</a>
        <a onclick="javascript:CKEDITOR.instances.content.insertText('#event.dateEnd#');">結束時間</a>
        <a onclick="javascript:CKEDITOR.instances.content.insertText('#event.checkInStart#');">報到開始</a>
        <a onclick="javascript:CKEDITOR.instances.content.insertText('#event.checkInEnd#');">報到結束</a>
        <a onclick="javascript:CKEDITOR.instances.content.insertText('#event.checkIn#');">報到方式</a>
        <a onclick="javascript:CKEDITOR.instances.content.insertText('#reader.name#');">讀者姓名</a>
        <a onclick="javascript:CKEDITOR.instances.content.insertText('#register.sysCode#');">系統碼</a>
        <a onclick="javascript:CKEDITOR.instances.content.insertText('#register.cancelCode#');">取消碼</a>
        <!--<a onclick="javascript:CKEDITOR.instances.content.insertText('#reader.meat#');">用餐</a>-->
        <!--<a onclick="javascript:CKEDITOR.instances.content.insertText('#reader.sleep#');">住宿</a>-->
    </div>
</div>
<div class="fieldcontain ${hasErrors(bean: informInstance, field: 'content', 'error')} required">
    <label for="content">
        <g:message code="inform.content.label" default="Content" />
        <span class="required-indicator">*</span>
    </label>
    <m:ckeditor name="content" value="${informInstance?.content}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: manualInstance, field: 'recipient', 'error')} ">
	<label for="recipient">
		<g:message code="manual.recipient.label" default="Recipient" />
		
	</label>
	<g:select name="recipient" from="${manualInstance.constraints.recipient.inList}" value="${manualInstance?.recipient}" valueMessagePrefix="manual.recipient" noSelection="['': '']"/>
</div>

<div class="fieldcontain ${hasErrors(bean: manualInstance, field: 'schedule', 'error')} ">
	<label for="schedule">
		<g:message code="manual.schedule.label" default="Schedule" />
		
	</label>
	<g:datePicker name="schedule" precision="day"  value="${manualInstance?.schedule}" default="none" noSelection="['': '']" />
</div>